<template>
  <view>
    <view class="navbar" v-if="jobType == 2 || jobType == 5 || jobType == 10">
      <view
        v-for="(item, index) in navList"
        :key="index"
        class="nav-item"
        :class="{ current: tabCurrentIndex === item.key }"
        @click="tabClick(item.key)"
      >
        {{ item.text }}
      </view>
    </view>
    <Form
      v-show="tabCurrentIndex == 'info'"
      :formOption="formOptions"
      ref="form"
      @onSubmit="onSubmit"
      :zyryList="zyryList"
      :zypList="zypList"
      :jobType="jobType"
    >
      <template #aqcsinput1="{ formData, option }">
        <uni-forms-item>
          <template #label>
            <view
              style="
                border-top: 1px solid #333;
                font-size: 13px;
                padding-top: 44upx;
              "
            >
              2.与动火设备相连接的所有管线已断开，加盲板(
              <input
                type="text"
                class="input-num"
                v-model="formData.mbnum"
              />)块，未采取水封或仅关闭阀门的方式代替盲板（监护人）
            </view>
          </template>
          <uni-data-checkbox
            v-model="formData.yesOrNo2"
            :localdata="[
              {
                value: '是',
                text: '涉及',
              },
              {
                value: '否',
                text: '不涉及',
              },
            ]"
            :multiple="false"
          ></uni-data-checkbox>
        </uni-forms-item>
      </template>
      <template #aqcsinput2="{ formData, option }">
        <uni-forms-item>
          <template #label>
            <view
              style="
                border-top: 1px solid #333;
                font-size: 13px;
                padding-top: 44upx;
              "
            >
              8.现场配备灭火器(
              <input
                type="text"
                class="input-num"
                v-model="formData.mhqnum"
              />)台，灭火毯(
              <input type="text" class="input-num" v-model="formData.mhtnum" />
              )块，消防蒸汽带或消防水带(
              <input
                type="text"
                class="input-num"
                v-model="formData.fsdnum"
              />)（监护人）
            </view>
          </template>
          <uni-data-checkbox
            v-model="formData.yesOrNo8"
            :localdata="[
              {
                value: '是',
                text: '涉及',
              },
              {
                value: '否',
                text: '不涉及',
              },
            ]"
            :multiple="false"
          ></uni-data-checkbox>
        </uni-forms-item>
      </template>
      <template #sckjinput="{ formData, option }">
        <uni-forms-item>
          <template #label>
            <view
              style="
                border-top: 1px solid #333;
                font-size: 13px;
                padding-top: 44upx;
              "
            >
              14.已配备作业应急措施：消防器材（
              <input
                type="text"
                class="input-num"
                v-model="formData.xfqcnum"
              />）、救生绳（
              <input type="text" class="input-num" v-model="formData.jssnum" />
              ）、气防装备（
              <input
                type="text"
                class="input-num"
                v-model="formData.qfsbnum"
              />），盛有腐蚀性介质的容器作业现场已配备应急用冲洗水（监护人）
            </view>
          </template>
          <uni-data-checkbox
            v-model="formData.yesOrNo14"
            :localdata="[
              {
                value: '是',
                text: '涉及',
              },
              {
                value: '否',
                text: '不涉及',
              },
            ]"
            :multiple="false"
          ></uni-data-checkbox>
        </uni-forms-item>
      </template>
      <template
        v-for="(item, index) in longLabelSlots"
        #[item]="{ formData, option }"
      >
        <uni-forms-item label="" :name="option.prop">
          <template #label>
            <view
              style="
                border-top: 1px solid #333;
                font-size: 13px;
                padding-top: 44upx;
              "
            >
              {{ option.label }}
            </view>
          </template>
          <uni-data-checkbox
            v-model="formData[option.prop]"
            :localdata="option.optionItems"
            :multiple="option.type == 'checkbox'"
            @change="change(option.prop, $event)"
          ></uni-data-checkbox>
        </uni-forms-item>
      </template>
      <template
        v-for="(item, index) in qianmingSlots"
        #[item]="{ formData, option }"
      >
        <uni-forms-item :label="option.label" :name="option.prop">
          <view v-if="jobType == 4 && option.prop == 'yjqm3'">
            <button
              type="primary"
              :disabled="qmDisabled(option, formData)"
              @click="adddthqqz"
              style="font-size: 28upx"
            >
              新增签字
            </button>
            <Qianming
              v-for="(item, index) in dthq"
              v-model="dthq[index]"
              :open="openQm"
              :disabled="qmDisabled(option, formData)"
            ></Qianming>
          </view>
          <view v-else-if="option.prop == 'jsjdr'">
            <button
              type="primary"
              :disabled="qmDisabled(option, formData)"
              @click="addjsjdrqz"
              style="font-size: 28upx"
            >
              新增签字
            </button>
            <Qianming
              v-for="(item, index) in jsjdrqz"
              v-model="jsjdrqz[index]"
              :open="openQm"
              :disabled="qmDisabled(option, formData)"
            ></Qianming>
          </view>
          <Qianming
            v-else
            @change="changeQm(option, formData)"
            v-model="formData[option.prop]"
            :canvasId="option.prop + `${index}qweqwe`"
            :open="openQm"
            :disabled="qmDisabled(option, formData)"
          ></Qianming>
          <!-- :disabled="qmDisabled(option)" -->
        </uni-forms-item>
      </template>
    </Form>
    <view
      class="container"
      v-show="tabCurrentIndex == 'qtjc'"
      style="padding: 5px 0 11vw"
    >
      <uni-card v-if="jobType == 10">
        <uni-forms label-position="top" :model="formData" label-width="100vw">
          <uni-forms-item label="有毒有害介质分析标准" name="fxsj">
            <uni-easyinput type="text" v-model="formData.ydyhwzfxbz" />
          </uni-forms-item>

          <uni-forms-item label="可燃气体分析标准" name="fxjg">
            <uni-easyinput type="text" v-model="formData.krqtfxbz" />
          </uni-forms-item>
          <uni-forms-item label="氧含量" name="fxjg">
            <uni-easyinput type="text" disabled :value="'19.5%-21%'" />
          </uni-forms-item>
        </uni-forms>
      </uni-card>
      <uni-card v-for="(item, index) in qitiData">
        <uni-forms
          v-if="jobType == 5 || jobType == 2"
          label-position="top"
          :model="item"
          label-width="100vw"
        >
          <uni-forms-item label="分析时间" name="fxsj">
            <uni-datetime-picker
              type="datetime"
              v-model="item.fxsj"
              :hide-second="true"
            />
          </uni-forms-item>
          <uni-forms-item v-if="jobType == 5" :label="'分析点'" name="dbxqt">
            <uni-easyinput type="text" v-model="item.dbxqt" />
          </uni-forms-item>
          <uni-forms-item v-else :label="'代表性气体'" name="dbxqt">
            <uni-data-select
              style="border: none"
              v-model="item.dbxqt"
              :localdata="[
                {
                  value: '可燃性气体',
                  text: '可燃性气体',
                },
                {
                  value: '有毒有害介质',
                  text: '有毒有害介质',
                },
                {
                  value: '氧气含量',
                  text: '氧气含量',
                },
              ]"
              @change="changeQt($event, item)"
            ></uni-data-select>
            <!-- <uni-easyinput type="text" v-model="item.dbxqt" /> -->
          </uni-forms-item>
          <uni-forms-item label="分析结果" name="fxjg">
            <uni-easyinput
              type="text"
              v-model="item.fxjg"
              placeholder="输入完后自动补全单位"
              @change="changefxjg($event, item)"
            >
            </uni-easyinput>
            <!-- <uni-easyinput type="text" v-model="item.fxjg" /> -->
          </uni-forms-item>
          <uni-forms-item label="分析人" name="fxr">
            <Qianming
              v-model="item.fxr"
              :canvasId="'fxr' + index"
              :open="openQm"
            ></Qianming>
          </uni-forms-item>
        </uni-forms>
        <uni-forms
          v-if="jobType == 10"
          label-position="top"
          :model="item"
          label-width="100vw"
        >
          <uni-forms-item label="有毒有害物质" name="dbxqt">
            <uni-easyinput
              @change="changeInput(item, 'ydyhwz', 'mg/m³')"
              type="text"
              v-model="item.ydyhwz"
            />
          </uni-forms-item>
          <uni-forms-item label="可燃气" name="dbxqt">
            <uni-easyinput
              type="text"
              @change="changeInput(item, 'krqt', '%LEL')"
              v-model="item.krqt"
            />
          </uni-forms-item>
          <uni-forms-item label="含氧量" name="dbxqt">
            <uni-easyinput
              type="text"
              @change="changeInput(item, 'hyl', '%')"
              v-model="item.hyl"
            />
          </uni-forms-item>
          <uni-forms-item label="取样时间" name="fxsj">
            <uni-datetime-picker
              type="datetime"
              v-model="item.fxsj"
              :hide-second="true"
            />
          </uni-forms-item>
          <uni-forms-item label="分析部位" name="dbxqt">
            <uni-data-select
              v-if="bwList.length"
              v-model="item.fxbw"
              :localdata="bwList"
              style="padding-bottom: 60px"
            >
            </uni-data-select>
            <uni-easyinput v-else type="text" v-model="item.fxbw" />
          </uni-forms-item>
          <uni-forms-item label="分析人" name="fxr">
            <Qianming
              v-model="item.fxr"
              :canvasId="'fxr' + index"
              :open="openQm"
            >
            </Qianming>
          </uni-forms-item>
        </uni-forms>
      </uni-card>
      <view class="botton-btm">
        <button
          @click="addQtjc"
          style="width: 100px; height: 40px"
          :disabled="qmDisabled({ prop: 'qitiData' })"
        >
          新增
        </button>
        <button
          @click="submitForm"
          type="primary"
          style="width: 100px; height: 40px"
        >
          提交
        </button>
      </view>
    </view>
    <catSignature
      :canvasId="cId + ''"
      @close="closeQm"
      @save="saveQm"
      :visible="true"
      v-if="showQm"
    />
  </view>
</template>
<script>
export default {
  data() {
    return {
      num: "",
      billNumber: "",
      billType: "",
      id: null,
      pid: null,
    };
  },
  onLoad(payload) {
    if (payload.id) {
      this.pid = payload.pid;
      this.billNumber = payload.billNumber;
      this.id = payload.id;
      return;
    }
    this.billNumber = payload.billNumber;
    this.pid = payload.pid;
    this.num = payload.num;
    this.billType = payload.billType;
  },
};
</script>
<script setup>
import Form from "./form.vue";
import { onMounted, ref, getCurrentInstance, computed } from "vue";
import zyp from "../options/index.js";
import { apis as APIS } from "@/api/zygl/zyjh.js";
import Qianming from "./qianming.vue";
import { apis } from "@/api/zygl/zyp";
import { router } from "@/router/index.js";
import catSignature from "@/components/cat-signature.vue";
import { formatDate } from "@/utils/index.js";
import { getUserProfile } from "@/api/user.js";

// 签字相关逻辑
const showQm = ref(false);
const example = ref(null);
const cId = ref(2112);
const openQm = (e) => {
  cId.value = Date.now();
  showQm.value = true;
  example.value = e;
};
const closeQm = () => {
  showQm.value = false;
};
const saveQm = (val) => {
  closeQm();
  example.value.exposed.save(val);
};
const change = (data) => {};
const changeQm = (option, data) => {
  if (option.qmDt) {
    if (data[option.prop]) {
      data[option.qmDt] = formatDate(Date.now());
    }
  }
};
// _______________________
const navList = ref([
  { text: "作业票信息", key: "info" },
  { text: "气体检测录入", key: "qtjc" },
]);
const tabCurrentIndex = ref("info");
const tabClick = (key) => {
  tabCurrentIndex.value = key;
};

const longLabelSlots = ref([]);
const qianmingSlots = ref([]);
const formOptions = ref([]);
const submitData = (data) => {
  if (data == false) return;
  let glzyps = [];
  if (data.glqtzyp && data.glqtzyp.length) {
    glzyps = zypList.value.filter((ele) => data.glqtzyp.includes(ele.value));
  }
  if (jobType.value == 4) {
    data.yjqm3 = dthq.value;
  }
  if (!keepId.value) {
    APIS.saveBillData({
      specialNumber: billNum.value,
      ptw: billNo.value,
      content: JSON.stringify({
        ...data,
        qitiData: qitiData.value,
        ...formData.value,
        dyjrdjxkydgl: data.dyjrd + " , " + data.xkydgl || null,
        yhsbjgl: data.edgl + " , " + data.ydmc || null,
        jsjdr: jsjdrqz.value,
      }),
      jobType: jobType.value,
      jobStartDate: data.jobDate[0],
      jobEndDate: data.jobDate[1],
      local: data.local,
      changeBillNumber: data.glqtzyp && data.glqtzyp.join(","),
      changeBillNumberId: glzyps.map((item) => item.id).join(","),
    }).then((res) => {
      router.back();
    });
  } else {
    apis
      .update({
        specialNumber: billNum.value,
        ptw: billNo.value,
        content: JSON.stringify({
          ...formData.value,
          ...data,
          qitiData: qitiData.value,
          dyjrdjxkydgl: data.dyjrd + " , " + (data.xkydgl || ""),
          yhsbjgl: data.edgl + " , " + (data.ydmc || ""),
          jsjdr: jsjdrqz.value,
        }),
        jobType: jobType.value,
        jobStartDate: data.jobDate[0],
        jobEndDate: data.jobDate[1],
        id: keepId.value,
        local: data.local,
        changeBillNumber: data.glqtzyp && data.glqtzyp.join(","),
        changeBillNumberId: glzyps.map((item) => item.id).join(","),
      })
      .then((res) => {
        router.back();
      });
  }
};
const onSubmit = (data) => {
  submitData(data);
};
const submitForm = async () => {
  const data = await form.value.getFormData();
  submitData(data);
};
const billNum = ref("");
const billNo = ref("");
const jobType = ref("");
const keepId = ref("");
const form = ref();
const qitiData = ref([]);
const formData = ref({});
const zyryList = ref([]);
const addQtjc = () => {
  qitiData.value.unshift({
    fxsj: null,
    dbxqt: null,
    fxjg: null,
    fxr: null,
  });
};
// 签名步骤
const step = ref({
  point: "",
  handById: "",
  step: "",
});
const userInfo = ref({});
// 关联作业票列表
const zypList = ref([]);
const zypTypes = {
  1: "吊装安全作业票",
  2: "动火安全作业票",
  3: "高处安全作业票",
  4: "动土安全作业票",
  5: "临时用电安全作业票",
  6: "动用射线安全作业票",
  7: "断路安全作业票",
  8: "盲板抽堵安全作业票",
  9: "设备开孔安全作业票",
  10: "受限空间安全作业票",
};
const lcry = ref({});
onMounted(() => {
  getUserProfile().then((res) => {
    userInfo.value = res.data;
  });
  let selfId = "";
  const { num, billNumber, billType, id, pid } = getCurrentInstance().data;
  if (id) {
  }
  apis
    .getGlzyp({
      ptw: billNumber,
    })
    .then((res) => {
      zypList.value = [
        ...res
          .filter((item) => item.id != selfId)
          .map((ele) => ({
            text: ele.specialNumber + "-" + zypTypes[ele.jobType],
            value: ele.specialNumber,
            id: ele.id,
            ptw: ele.ptw,
          })),
        // ,{
        //   value: '无',
        //   text: '无'
        // },
      ];
    });
  APIS.detail(pid).then((data) => {
    try {
      zyryList.value = JSON.parse(data.jobPersonnel) || [];
    } catch (error) {
      zyryList.value = [];
    }
    if (id) {
      keepId.value = id;
      selfId = id;
      const typeNode = zyryList.value.find(
        (user) => user.id == data.jobPersonChargeId
      );
      // apis.nextStep(keepId.value).then((result) => {
      //   if (result.data) {
      //     step.value = result.data;
      //   }
      // });
      apis.detail(id).then((res) => {
        billNum.value = res.specialNumber;
        billNo.value = res.ptw;
        jobType.value = res.jobType;
        const option = zyp[res.jobType];
        formData.value = JSON.parse(res.content);
        qitiData.value = formData.value.qitiData || [];
        // if(res.jobType == )
        apis
          .hqlc({
            createJobId: Number(id),
            jobType: res.jobType,
            personnelType: (typeNode && typeNode.type) || "out",
            jobGrade:
              formData.value.dhzyjb ||
              formData.value.Grade ||
              formData.value.zyjb ||
              null,
          })
          .then((res) => {
            const map = {
              hasLc: false,
            };
            res.data.forEach((item) => {
              if (!map.hasLc) {
                map.hasLc = true;
              }
              map[item.nodeName] = item.configNameList.map(
                (user) => user.signedBy
              );
            });
            lcry.value = map;
          });
        let jsjdr = [];
        let dtyjqm3 = [];
        if (formData.value.jsjdr && formData.value.jsjdr instanceof Array) {
          jsjdr = [...formData.value.jsjdr];
        }
        if (formData.value.jsjdr1 && !jsjdr.includes(formData.value.jsjdr1)) {
          jsjdr.push(formData.value.jsjdr1);
        }
        if (jobType.value == 4) {
          if (typeof formData.value.yjqm3 == "object") {
            dtyjqm3 = formData.value.yjqm3 || [];
          } else if (typeof formData.value.yjqm3 == "string") {
            dtyjqm3 = [formData.value.yjqm3] || [];
          }
        }
        jsjdrqz.value = jsjdr.filter((item) => !!item) || [];
        dthq.value = dtyjqm3.filter((item) => !!item);
        formData.value.glqtzyp =
          res.changeBillNumber && res.changeBillNumber.split(",");
        formData.value.jobDate = formData.value.jobDate || ["", ""];
        form.value.setFormData(formData.value);
        if (option) {
          formOptions.value = option.formOptions;
          form.value.setOptions(option.formOptions);
          longLabelSlots.value = option.longLabelSlots;
          qianmingSlots.value = option.qianmingSlots;
        }
      });
      return;
    }
    billNum.value = num;
    billNo.value = billNumber;
    jobType.value = billType;
    const option = zyp[billType];
    formData.value.krqtfxbz = "%LEL";
    formData.value.ydyhwzfxbz = "mg/m³";
    form.value.setFormData({
      titleCode: billNum.value,
      sqr: data.applyPeople,
      local: data.local,
      zynr: data.jobContent,
      jobContent: data.jobContent,
      jobApplyCompany: data.applyCompany,
      zysqdw: data.applyCompany,
      zydw: data.workShop,
      zyjhr: data.custody,
      zydwjhr: data.custody,
      jhr: data.custody,
      custody: data.custody,
      zyfzr: data.jobPersonCharge,
      zydwfzr: data.jobPersonCharge,
      jobCompany: data.workShop,
      dlyy: data.jobContent,
      zyyy: data.jobContent,
      jobDate: [
        `${data.jobPlanStartDate} ${data.jobPlanStartTime}`,
        `${data.jobPlanEndDate} ${data.jobPlanEndTime}`,
      ],
    });
    if (option) {
      formOptions.value = option.formOptions;
      form.value.setOptions(option.formOptions);
      longLabelSlots.value = option.longLabelSlots;
      qianmingSlots.value = option.qianmingSlots;
    }
  });
});

// 签名禁用
const qmDisabled = (option, formData) => {
  // 解除注释关闭流程
  // return false;

  // 断路示意图默认可以签字
  if (option.prop == "sytqz") {
    return false;
  }
  // 没有id时默认禁用签字
  if (!keepId.value) {
    return true;
  }
  // 未配置流程是默认开启签字
  if (!lcry.value.hasLc) {
    return false;
  }
  // 未匹配对应人员默认禁用
  if (
    !lcry.value[option.prop] ||
    !lcry.value[option.prop].includes(userInfo.value.userId)
  ) {
    return true;
  }
  // 盲板抽堵完工单独判断
  if (
    jobType.value == 8 &&
    (option.prop == "yjqm3" || option.prop == "yjqm4")
  ) {
    let flag =
      option.qianzhi.every((ele) => !!formData[ele]) &&
      jsjdrqz.value.length > 0 &&
      jsjdrqz.value[0];
    return !flag;
  }

  // 射线完工单独判断
  if (
    jobType.value == 6 &&
    (option.prop == "zyryqz" || option.prop == "zybmqz")
  ) {
    let flag =
      option.qianzhi.every((ele) => !!formData[ele]) &&
      jsjdrqz.value.length > 0 &&
      jsjdrqz.value[0];
    return !flag;
  }

  // 二级动火yjqm5单独判断
  if (
    jobType.value == 2 &&
    option.prop == "yjqm5" &&
    formData.dhzyjb == "二级（72H）"
  ) {
    let flag =
      !!formData.yjqm4 &&
      !!formData.aqjdr &&
      !!formData.qianming1 &&
      jsjdrqz.value.length > 0 &&
      jsjdrqz.value[0] &&
      qitiData.value.length > 0 &&
      qitiData.value.every((ele) => !!ele.fxr);
    return !flag;
  }
  // 用电完工单独判断
  if (jobType.value == 5 && option.prop == "yjqm5") {
    let flag =
      option.qianzhi.every((ele) => !!formData[ele]) &&
      jsjdrqz.value.length > 0 &&
      jsjdrqz.value[0] &&
      qitiData.value.length > 0 &&
      qitiData.value.every((ele) => !!ele.fxr);
    return !flag;
  }
  // 斷路完工单独判断
  if (jobType.value == 7 && option.prop == "yjqm4") {
    let flag =
      option.qianzhi.every((ele) => !!formData[ele]) &&
      jsjdrqz.value.length > 0 &&
      jsjdrqz.value[0];
    return !flag;
  }
  // 吊装完工单独判断
  if (jobType.value == 1 && option.prop == "yjqm5") {
    let flag =
      !!formData.yjqm3 &&
      !!formData.aqjdr &&
      !!formData.qianming1 &&
      jsjdrqz.value.length > 0 &&
      jsjdrqz.value[0];
    console.log(flag);
    return !flag;
  }
  // 动土，吊装，高处完工单独判断
  if ([1, 3, 4].includes(Number(jobType.value)) && option.prop == "yjqm5") {
    let flag =
      option.qianzhi.every((ele) => !!formData[ele]) &&
      jsjdrqz.value.length > 0 &&
      jsjdrqz.value[0];
    return !flag;
  }
  // 动土yjqm4单独判断
  if (jobType.value == 4 && option.prop == "yjqm4") {
    let flag = dthq.value.length > 0 && dthq.value[0];
    return !flag;
  }
  if (
    option.prop.includes("jsjdr") ||
    option.prop.includes("zyfwqz") ||
    option.prop.includes("qianming1") ||
    option.prop.includes("qitiData") ||
    option.prop.includes("aqjdr") ||
    option.prop.includes("bmjhr") ||
    option.prop.includes("fhjhr") ||
    (option.prop == "yjqm1" &&
      ![10, 2].includes(Number(jobType.value)) &&
      formData.dhzyjb != "二级（72H）")
  ) {
    return false;
  } else if (
    option.prop == "yjqm1" &&
    jsjdrqz.value.length > 0 &&
    jsjdrqz.value[0] &&
    formData.qianming1 &&
    formData.aqjdr &&
    (qitiData.value.length > 0 || ![2, 5, 10].includes(Number(jobType.value)))
  ) {
    return false;
  } else if (option.qianzhi && formData[option.qianzhi]) {
    return false;
  } else {
    return true;
  }
};
// 自动填写单位
const changeInput = (data, key, hz) => {
  if (!hz || data[key].includes(hz) || !data[key]) {
    return;
  } else {
    data[key] = data[key] + hz;
  }
};

// 生成部位
const bwList = computed(() => {
  if (formData.value.sxkjmc) {
    return [
      {
        value: formData.value.sxkjmc + "顶部",
        text: formData.value.sxkjmc + "顶部",
      },
      {
        text: formData.value.sxkjmc + "中部",
        value: formData.value.sxkjmc + "中部",
      },
      {
        text: formData.value.sxkjmc + "底部",
        value: formData.value.sxkjmc + "底部",
      },
      {
        text: formData.value.sxkjmc + "右侧",
        value: formData.value.sxkjmc + "右侧",
      },
      {
        text: formData.value.sxkjmc + "左侧",
        value: formData.value.sxkjmc + "左侧",
      },
    ];
  } else {
    return [];
  }
});

// 自动携带后缀
const changefxjg = (val, item) => {
  if (val.includes(item.hz)) {
    return;
  } else if (val) {
    item.fxjg = item.fxjg + (item.hz || "%LEL");
  }
};
const changeQt = (val, item) => {
  if (val == "氧气含量") {
    item.hz = "%";
  } else if (val == "有毒有害介质") {
    item.hz = "mg/m³";
  } else {
    item.hz = "%LEL";
  }
  let jg = item.fxjg || "";
  if (jg.includes("%")) {
    jg = jg.split("%")[0];
  } else if (jg.includes("mg/m³")) {
    jg = jg.split("mg/m³")[0];
  } else if (jg.includes("%LEL")) {
    jg = jg.split("%LEL")[0];
  }
  if (item.fxjg) {
    item.fxjg = jg + item.hz;
  }
};

// 安全交底人签字相关逻辑
const jsjdrqz = ref([""]);
const addjsjdrqz = () => {
  jsjdrqz.value.unshift("");
};
// 动土会签
const dthq = ref([]);
const adddthqqz = () => {
  dthq.value.unshift("");
};
</script>

<style lang="scss" scoped>
.input-num {
  display: inline-block;
  width: 50px;
  border: none;
  border-bottom: 1px solid #000;
  font-size: 13px;
  padding: 0 !important;
  vertical-align: middle;
}
.navbar {
  display: flex;
  height: 40px;
  padding: 0 5px;
  background: #fff;
  box-shadow: 0 1px 5px rgba(0, 0, 0, 0.06);
  position: relative;
  z-index: 10;

  .nav-item {
    flex: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100%;
    font-size: 15px;
    position: relative;

    &.current {
      color: blue;

      &:after {
        content: "";
        position: absolute;
        left: 50%;
        bottom: 0;
        transform: translateX(-50%);
        width: 44px;
        height: 0;
        // border-bottom: 2px solid $base-color;
      }
    }
  }
}
.botton-btm {
  height: 11vw;
  position: fixed;
  bottom: 0;
  width: 100vw;
  display: flex;
  justify-content: space-around;
}
</style>
